extends layout

block content
  div.container-fluid
    div.row
      div.col-md-4
        div.newCode
          h3 New Code
          div.form-group
            label.col-md-4.control-label(for="modeSelect") 选择代码类型
            div.col-md-8
              select.form-control#modeSelect
          div.form-group
            label.col-md-4.control-label(for="title") 标题
            div.col-md-8
              input(type="text" placeholder="标题").form-control#title
          div.form-group
            label.col-md-4.control-label(for="desc") 描述
            div.col-md-8
              textarea(placeholder="描述" rows="3").form-control#desc
          div.form-group
            div.col-md-12
              button#submit.btn.btn-raised.btn-block.btn-success 提交
            div.col-md-6.changeGroup
              button#change.btn.btn-raised.btn-block.btn-info 修改
            div.col-md-6.changeGroup
              button#cancel.btn.btn-raised.btn-block.btn-danger 取消修改
      div.col-md-8
         div.form-group
            textarea#code
  div.container-fluid
    div.row
      each snippet in snippets
        div.col-md-4.col-lg-3
          div.list-group
            div.list-group-item
              div.row-content
                div.action-secondary
                h4.list-group-item-heading= snippet.title
                p.list-group-item-text= snippet.desc
                button.btn.btn-success.btn-raised(onclick="edit('" + snippet._id + "')") 修改
                button#change.btn.btn-raised.btn-info(data-toggle="modal" data-target="#share" onclick="share('" + snippet.id + "')") 外链
                button.btn.btn-danger.btn-raised(onclick="del('" + snippet._id + "')") 删除
  div#share.modal.fade(tabindex="-1")
    div.modal-dialog
      div.modal-content
        div.modal-header
          button(type="button" data-dismiss="modal" aria-hidden="true").close &times;
          h4.modal-title 外链
        div.modal-body
          p#shareContent aaaaa
        div.modal-footer
          button(type="button" data-dismiss="modal").btn.btn-primary 关闭

block addStyles
  link(href="/codemirror/lib/codemirror.css", rel="stylesheet")
  style(rel="stylesheet").
    .row-content {
      width:100% !important;
    }

block addScripts
  script(src="/codemirror/lib/codemirror.js")
  script(src="/codemirror/addon/mode/loadmode.js")
  script(src="/codemirror/mode/meta.js")
  script(src="/javascripts/me.js")
  